关于<asp:dropdownlist>控件 (c)

来源:百度知道 编辑:UC知道 时间:2024/06/25 22:07:43
省与城市之间的联系的代码该怎么写?

具体内容如下:
有两个下拉列表框,一个是省,一个是城市。

我需要实现的功能:
选择 湖南 省 ,另外一个下拉列表框则显示出属于湖南省范围内的城市。

选择 湖北省 ,另外一个下拉列表框则显示出属于湖北省范围内的城市。

等等
搞错了,真对不起,编程语言应该是:C#,不是C

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
cDataSource.XPath = string.Format("/citys/city[@pid='{0}']", province.SelectedValue);
city.DataBind();
}
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<body>
<asp:XmlDataSourc